<template>
  <form-item :form-datas = "formDatas" :form-item = "field" :parent-comp-type = "parentCompType"
  >
    <el-select
        :allow-create = "field.preps['allowCreate']"
        :autocomplete = "field.preps['autocomplete']"
        :automatic-dropdown = "field.preps['automaticDropdown']"
        :clear-icon = "field.preps['clearIcon']"
        :clearable = "field.preps['clearable']"
        :collapse-tags = "field.preps['collapseTags']"
        :collapse-tags-tooltip = "field.preps['collapseTagsTooltip']"
        :default-first-option = "field.preps['defaultFirstOption']"
        :deprecated = "field.preps['deprecated']"
        :disabled = "field.preps['disabled']"
        :effect = "field.preps['effect']"
        :filter-method = "field.preps['filterMethod']"
        :filterable = "field.preps['filterable']"
        :fit-input-width = "field.preps['fitInputWidth']"
        :loading = "field.preps['loading']"
        :loading-text = "field.preps['loadingText']"
        :multiple = "field.preps['multiple']"
        :multiple-limit = "field.preps['multipleLimit']"
        :name = "field.preps['name']"
        :no-data-text = "field.preps['noDataText']"
        :no-match-text = "field.preps['noMatchText']"
        :persistent = "field.preps['persistent']"
        :placeholder = "field.preps['placeholder']"
        :placement = "field.preps['placement']"
        :popper-class = "field.preps['popperClass']"
        :remote = "field.preps['remote']"
        :remote-method = "field.preps['remoteMethod']"
        :remote-show-suffix = "field.preps['remoteShowSuffix']"
        :reserve-keyword = "field.preps['reserveKeyword']"
        :size = "field.preps['size']"
        :suffix-icon = "field.preps['suffixIcon']"
        :suffix-transition = "field.preps['suffixTransition']"
        :tag-type = "field.preps['tagType']"
        :teleported = "field.preps['teleported']"
        :value-key = "field.preps['valueKey']"
        v-model = "starHorseDynamicForm[field.preps['name']]">

      <el-option :disabled = "items['disabled']" :label = "items['label']" :value = "items['value']"
                 v-for = "items in field.preps['values']"/>
    </el-select>

  </form-item>
</template>

<script>
import FormItem from "./form-item";

export default {
  name: "select-item",
  components: {FormItem},
  props: {
    parentCompType: {type: Object},
    starHorseDynamicForm: {type: Object},
    field: {
      type: Object
    },
    formDatas: {type: Object}
  },
  data() {
    let formItem = {label: "input", required: false};
    return {
      formItem,
      dataField: ""
    }
  },
  methods: {
    selectItem(data) {
      let _this = this;
      _this.$emit("selectItem", data, _this.parentCompType);
    }
  }
}
</script>

<style scoped>

</style>